<?php
require_once ("src/db/connectdatabase.php");

$title = "Tính lãi suất và số tiền cho vay thế chấp tài sản - Tài Chính Online";
$keywords = "vay thế chấp nhà sổ hồng, cách tính lãi suất, tính số tiền phải trả hàng tháng, công cụ tính lãi suất vay vốn, ước tính số tiền vay, vay ngân hàng thế chấp";
$description = "Tổng quan cách tính lãi suất và công cụ tính toán dành cho các khoản vay thế chấp tài sản, vay kinh doanh thế chấp nhà và ô tô và các tài sản khác - Tài Chính Online";


function getIntroLoan() {
	$con = new ConnectDB();
	$tbl = "loans";
	$fn = array('info_emi_loan', 'intro_emi_footer_loan');
	$condetion = array('loan_id' => "vay_the_chap");
	return $con -> getvalue($tbl, $fn, $condetion);
}


function getRateBasicMorts() {
	$con = new ConnectDB();
	
	$sql = "Select r.bankid, b.bankname, r.basic_rate1, r.basic_rate2, r.datecreate FROM rate_basic_mortgage as r, banks as b WHERE r.bankid = b.bankid AND r.basic_isuse=1 ORDER BY r.bankid";
	return $con -> getvalueString($sql);
}

$intro = getIntroLoan();
$ratedatebasic = getRateBasicMorts();
	?>
<link rel="stylesheet" type="text/css" href="<?php echo($host) ?>css/jquery_ui_css.css"/>
<script type="text/javascript" src="<?php echo($host) ?>js/jquery-ui.js"></script>
<script type="text/javascript" src="<?php echo($host) ?>js/highcharts.js"></script>
<script type="text/javascript" src="<?php echo($host) ?>js/amort1.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo($host) ?>css/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="<?php echo($host) ?>css/home-loan-emi-calculator.css"/>

<style>
.emi_right_box {
	float: left;
	width: 340px;
	border: 5px solid #547295;
}

.emi_sum_amount {
	float: left;
	padding: 5px;
	width: 160px;
}

.emi_sum_value {
	float: right;
	padding: 5px;
	font-size: 13px;
	font-weight: bold;
	width: 158px;
	height: 15px;
}

.default_td {
	border: 1px solid #DBDAD7;
	background: #fffff;
	border-top: 0;
	font: 12px Arial, Helvetica, sans-serif;
}
</style>

<script>
//loan amount
$(function() {
			$( "#slider_la" ).slider({
			range: "min",
			value: 10000000000,
			min: 100000000,
			step: 100000000,
			max:  50000000000,
			slide: function( event, ui ) {
				$( "#amount_1a" ).val( "" + ui.value );
			}
			,change:function(){EMI_calc()}
		});
		$( "#amount_1a" ).val( "" + $( "#slider_la" ).slider( "value" ) );
	});

//interest rate
$(function() {
			$( "#slider_intr" ).slider({
			range: "min",
			value: 14.5,
			min: 10,
			step: .5,
			max:  20,
			slide: function( event, ui ) {
				$( "#amount_intr" ).val( "" + ui.value );
			}
			,change:function(){EMI_calc()}
		});
		$( "#amount_intr" ).val( "" + $( "#slider_intr" ).slider( "value" ) );
	});

//loan tenure

$(function() {
			$( "#slider_lt" ).slider({
			range: "min",
			value: 10,
			min: 5,
			step: 1,
			max:  25,
			slide: function( event, ui ) {
				$( "#amount_lt" ).val( "" + ui.value );
			}
			,change:function(){EMI_calc()}
		});
		$( "#amount_lt" ).val( "" + $( "#slider_lt" ).slider( "value" ) );
	});

$(document).ready(function(e) {
    EMI_calc();
	$("#amount_1a").val($("#amount_1a").val()).change();
});

function EMI_calc(){
		var emiPrincipal=jQuery("#amount_1a").val();
	var emiRate=jQuery("#amount_intr").val()/12/100;
	var emiTenure=jQuery("#amount_lt").val()*12;
	var emi=emiPrincipal*emiRate*(Math.pow(1+emiRate,emiTenure)/(Math.pow(1+emiRate,emiTenure)-1));
	jQuery("#emi_monthly span").text(number_format(Math.round(emi)) + " VNĐ");
	jQuery("#total_intr span").text(number_format(Math.round(emi* emiTenure-emiPrincipal)) + " VNĐ");
	jQuery("#total_amt span").text(number_format(Math.round(emi*emiTenure)) + " VNĐ");
	jQuery("#loan_amt span").text(number_format(Math.round(emiPrincipal)) + " VNĐ");
	var month_emi=Math.round(emi);
	var emi_tenure=Math.round(emiTenure);

var intRate = emiRate * 12 * 100;
commitData(emiPrincipal,intRate,emiTenure);
displayBarChart (emiPrincipal,intRate,emiTenure);
fillrates(emiPrincipal,emiTenure);

displayPieChart(month_emi,emi_tenure,emiPrincipal);
}

function fillrates(emiPrincipal,emiTenure)
{
	<?php
	foreach($ratedatebasic as $entry) {
		$entry[0] = preg_replace('/[\s]+/','',$entry[0]);
		echo('var '.$entry[0].'_rate1='.$entry[2].'/1200;');
		echo('var '.$entry[0].'_rate2='.$entry[3].'/1200;');
		echo('var getemicalc'.$entry[0].'1=emiPrincipal*'.$entry[0].'_rate1*(Math.pow(1+'.$entry[0].'_rate1, emiTenure) / (Math.pow(1+'.$entry[0].'_rate1, emiTenure) - 1));');
		echo('var getemicalc'.$entry[0].'2=emiPrincipal*'.$entry[0].'_rate2*(Math.pow(1+'.$entry[0].'_rate2, emiTenure) / (Math.pow(1+'.$entry[0].'_rate2, emiTenure) - 1));');
		echo('var viewemi'.$entry[0].'=number_format(Math.round(getemicalc'.$entry[0].'1)) + " VNĐ - " + number_format(Math.round(getemicalc'.$entry[0].'2)) + " VNĐ";');
		echo('jQuery("#'.$entry[0].'_bnk span").text(viewemi'.$entry[0].');');
	}
	?>
}

function displayPieChart(month_emi,emi_tenure,emiPrincipal)
	{ 
		piechart=new Highcharts.Chart({
		chart:{renderTo:"container",
	plotBackgroundColor:null,
	plotBorderWidth:null,
	width: 200,
				height:200,
			plotShadow:true},
			title:false,
			tooltip:{
			formatter:function(){return"<b>"+this.point.name+"</b>: "+this.y+" %"}},
plotOptions:{
				pie:{allowPointSelect:true,cursor:"pointer",
					dataLabels:{enabled:false,  color: '#000000'},
					showInLegend:true}},
					series:[{type:"pie",
					name:" ",
					data:[["Số Tiền Cho Vay",
					Math.round(emiPrincipal* 100/(month_emi*emi_tenure))],
					{name:"Tổng Số Lãi",
					y:Math.round(100-emiPrincipal*100/(month_emi*emi_tenure)),
				sliced:true,selected:true}]}]})
		}
	
	function displayBarChart (loanAmount,intRate,numPay)
{
	var monPmt=calcMonthly(loanAmount,numPay,intRate);
	var finalVal = amortizePmtsCharts(loanAmount,intRate,numPay,monPmt);
 	
	var principalAxis = [];
	principalAxis = finalVal[0];
	var intrAxis = finalVal[1];
	var catxAxis = finalVal[2];
	var sWidth = screen.width;
	var totWidth;
	var totHeight;
	if(sWidth>680) { totWidth = 550; totHeight = 300; } else { totWidth = 300; totHeight = 200; }//550
 chart = new Highcharts.Chart({
            chart: {
                renderTo: 'barChart',
                type: 'bar',
				height:500
            },
            title: {
                text:false
            },
            xAxis: {
                categories: catxAxis, labels:{rotation:-25}
            },
            yAxis: {
                min: 0,
                title: {
                    text: 'Gốc + Lãi ( Đơn vị: Triệu Đồng )'
                }
            },
            legend: {
                backgroundColor: '#FFFFFF',
                reversed: true
            },
            tooltip: {
                formatter: function() {
                    return ''+
                        this.series.name +': '+ number_format(this.y) +'';
                }
            },
            plotOptions: {
                series: {
                    stacking: 'normal'
                }
            },
                series: [{
                name: 'Gốc',
                data: principalAxis
            }, {
               name: 'Lãi',
               data: intrAxis
            }]
        });
}	
</script>
<style type="text/css">

/* Big box with list of options */
#ajax_listOfOptions {
	position: absolute; /* Never change this one */
	width: 250px; /* Width of box */
	height: 160px; /* Height of box */
	overflow: auto; /* Scrolling features */
	border: 1px solid #317082; /* Dark green border */
	background-color: #FFF; /* White background color */
	color: black;
	text-align: left;
	font-size: 10px;
	z-index: 50;
}

#ajax_listOfOptions div {
	/* General rule for both .optionDiv and .optionDivSelected */
	margin: 1px;
	padding: 1px;
	cursor: pointer;
	font-size: 10px;
}

#ajax_listOfOptions .optionDivSelected { /* Selected item in the list */
	background-color: #2375CB;
	color: #FFF;
}

#ajax_listOfOptions_iframe {
	background-color: #F00;
	position: relative;
	z-index: 5;
}

form {
	display: inline;
}
</style>

<div class="text12"
            style="margin: auto; width: 100%; height: 11px; margin-top: 11px; color: #0a8bd9;">
            <u><a href="http://taichinhonline.vn" class="text12" style="color: #0080d6;">Trang chủ</a></u>&gt; <u><a href="<?php echo($host) ?>cho-vay-the-chap.html" class="text12" style="color: #0080d6;">Vay thế chấp</a></u>&gt; Công cụ tính toán</span>
        </div>
        <div style="clear: both;"></div>
        <div class="pl_emi_cal_text" style=" margin-top: 20px;">
            <?php 
            if(count($intro) == 1) {
            ?>
            <div class="text11" style="color: #4c4c4c; margin-top: 10px;"><?php echo($intro[0][0]) ?></div>
            <?php
            }
            ?>
        </div>
        <div style="clear: both;"></div>
        <div style="clear: both; height: 15px;"></div>
        <div class="process_sec"><strong>Bước 1: Vui lòng cung cấp thông tin cá nhân</strong></div>
        <div class="pl_form_emi_box">
				
				<style>
.ui-dialog {
	position: absolute;
	padding: .2em;
	width: 700px;
	overflow: hidden;
	z-index: 1001;
}

.ui-dialog .ui-dialog-titlebar {
	padding: .4em 1em;
	position: relative;
}

.ui-dialog .ui-dialog-title {
	float: left;
	margin: .1em 16px .1em 0;
	font-size: 11px;
	line-height: 18px;
}

.ui-dialog .ui-dialog-titlebar-close {
	position: absolute;
	right: .3em;
	top: 50%;
	width: 19px;
	margin: -10px 0 0 0;
	padding: 1px;
	height: 18px;
}

.ui-dialog .ui-dialog-titlebar-close span {
	display: block;
	margin: 1px;
}

.ui-dialog .ui-dialog-titlebar-close:hover,.ui-dialog .ui-dialog-titlebar-close:focus
	{
	padding: 0;
}

.ui-dialog .ui-dialog-buttonpane {
	text-align: left;
	border-width: 1px 0 0 0;
	background-image: none;
	margin: .5em 0 0 0;
	padding: .3em 1em .5em .4em;
}

.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
	float: right;
}

.ui-dialog .ui-dialog-buttonpane button {
	margin: .5em .4em .5em 0;
	cursor: pointer;
}

.ui-dialog .ui-resizable-se {
	width: 14px;
	height: 14px;
	right: 3px;
	bottom: 3px;
}

.ui-draggable .ui-dialog-titlebar {
	cursor: move;
}
</style>


<!--- bang dang ky --->
<form name="loan_form" method="post" action="" onsubmit="return chkform();">
<input type="hidden" name="Type_Loan" value="vay_tra_gop" />
	<table width="663" border="0" align="center" cellpadding="0" cellspacing="0">
		<tbody>
			<tr>
				<td align="left" valign="top">
                	<table width="960" border="0" cellspacing="0" cellpadding="0">
						<tbody>
							<tr>
								<td height="14" align="left" valign="top">
                                	<img src="<?php echo($host) ?>images/bgtop1.jpg" width="960" height="14">
								</td>
							</tr>
							<tr>
								<td height="75" align="left" valign="top" bgcolor="#8DAE48">
                                	<table width="955" border="0" cellspacing="0" cellpadding="0">
										<tbody>
                                        	<tr>
                                            	<td width="24" height="36">&nbsp;</td>
                                                <td width="735"><div class="text3" style="color: #FFF; font-size: 24px; text-transform: none;"> <strong>Thông Tin Của Bạn</strong></div></td>
                                                <td width="196" rowspan="2" valign="top">&nbsp;</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
                            <tr>
                            	<td align="center" valign="top" bgcolor="#8DAE48">
                                	<table width="943" border="0" cellpadding="0" cellspacing="0">
                                    	<tbody>
                                       	  <tr>
                                            	<td width="11" rowspan="2" align="left" valign="top">&nbsp;</td>
                                                <td width="183" align="left" valign="top">
                                                	<table width="183" border="0" cellspacing="0" cellpadding="0">
                                                    	<tbody>
                                                        	<tr>
                                                            	<td width="183" height="58" align="left" valign="top">
                                                                	<div style="float: left; width: 183px; height: 47px; margin-left: 0px; margin-top: 5px;">
                                                                    	<div class="text" style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">Họ Tên:</div>
                                                                        <div class="text" style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none; margin-top: 5px;">
                                                                        	<input name="Name" id="Name" type="text" style="width: 180px; height: 30px;" onkeydown="validateDiv(&#39;nameVal&#39;);" maxlength="500">
																			<div id="nameVal"></div>
																		</div>
																	</div>
																</td>
															</tr>
															<tr>
																<td height="55" align="left" valign="top">
                                                                	<div style="float: left; width: 183px; height: 47px; margin-left: 0px; margin-top: 5px;">
                                                                    	<div class="text" style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">Ngày Sinh:</div>
                                                                        <div class="text" style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none; margin-top: 5px;">
                                                                          <input name="birthday" id="birthday" type="text" style="width: 180px; height: 30px;" value="" onkeyup="intOnly(this);" onkeypress="intOnly(this);" onkeydown="validateDiv(&#39;dobVal&#39;);" placeholder="DD/MM/YYYY" maxlength="10" >
																			<div id="dobVal"></div>
																		</div>
																	</div>
																</td>
															</tr>
															<tr>
																<td height="58">
                                                                	<div style="float: left; width: 183px; height: 47px; margin-left: 0px; margin-top: 5px;">
                                                                    	<div class="text" style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">
                                                                        	<span class="text" style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">Điện Thoại:</span>
																		</div>
                                                                        <div class="text" style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none; margin-top: 5px;">
                                                                        	<div class="text" style="float: left; width: 26px; height: auto; color: #FFF; font-size: 12px; text-transform: none; clear: right; margin-top: 3px;"> +84</div>
                                                                            <div class="text" style="float: left; width: 26px; height: auto; color: #FFF; font-size: 12px; text-transform: none; clear: right;"> 
                                                                            	<input name="Phone" id="Phone" maxlength="12" onkeyup="intOnly(this);" onkeypress="intOnly(this);" onchange="intOnly(this);" type="text" style="width: 153px; height: 18px;" onkeydown="validateDiv(&#39;phoneVal&#39;);">
																				<div id="phoneVal"></div>
																			</div>
																		</div>
																	</div>
																</td>
															</tr>
														</tbody>
													</table>
												</td>
												<td width="58" align="left" valign="top">&nbsp;</td>
											<td width="185" align="left" valign="top">
                                           	  <table width="192" border="0" cellspacing="0" cellpadding="0">
												<tbody>
															<tr>
                                                            	<td width="192" height="58" align="left" valign="top">
                                                                	<div style="float: left; width: 183px; height: 47px; margin-left: 0px; margin-top: 5px;">
                                                                    	<div class="text" style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">Tỉnh Thành:</div>
                                                                        <div class="text" style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none; margin-top: 5px;">
                                                                        	<select name="City" id="City" style="width: 180px; height: 30px; font-family: Verdana, Geneva, sans-serif; font-size: 11px; color: #4c4c4c;" onchange="cityother(); addhdfclife(); validateDiv(&#39;cityVal&#39;);" tabindex="7">
                                                                            	<option value="Please Select">Vui Lòng Chọn</option><option value="Hà Nội">Hà Nội</option><option value="TP HCM">TP HCM</option><option value="TP Cần Thơ">TP Cần Thơ</option><option value="TP Đà Nẵng">TP Đà Nẵng</option><option value="TP Hải Phòng">TP Hải Phòng</option><option value="An Giang">An Giang</option><option value="Bà Rịa - Vũng Tàu">Bà Rịa - Vũng Tàu</option><option value="Bắc Giang">Bắc Giang</option><option value="Bắc Kạn">Bắc Kạn</option><option value="Bạc Liêu">Bạc Liêu</option><option value="Bắc Ninh">Bắc Ninh</option><option value="Bến Tre">Bến Tre</option><option value="Bình Định">Bình Định</option><option value="Bình Dương">Bình Dương</option><option value="Bình Phước">Bình Phước</option><option value="Bình Thuận">Bình Thuận</option><option value="Cà Mau">Cà Mau</option><option value="Cao Bằng">Cao Bằng</option><option value="Đăk Lăk">Đăk Lăk</option><option value="Đak Nông">Đak Nông</option><option value="Điện Biên">Điện Biên</option><option value="Đồng Nai">Đồng Nai</option><option value="Đồng Tháp">Đồng Tháp</option><option value="Gia Lai">Gia Lai</option><option value="Hà Giang">Hà Giang</option><option value="Hà Nam">Hà Nam</option><option value="Hà Tĩnh">Hà Tĩnh</option><option value="Hải Dương">Hải Dương</option><option value="Hậu Giang">Hậu Giang</option><option value="Hòa Bình">Hòa Bình</option><option value="Hưng Yên">Hưng Yên</option><option value="Khánh Hòa">Khánh Hòa</option><option value="Kiên Giang">Kiên Giang</option><option value="Kon Tum">Kon Tum</option><option value="Lai Châu">Lai Châu</option><option value="Lâm Đồng">Lâm Đồng</option><option value="Lạng Sơn">Lạng Sơn</option><option value="Lào Cai">Lào Cai</option><option value="Long An">Long An</option><option value="Nam Định">Nam Định</option><option value="Nghệ An">Nghệ An</option><option value="Ninh Bình">Ninh Bình</option><option value="Ninh Thuận">Ninh Thuận</option><option value="Phú Thọ">Phú Thọ</option><option value="Phú Yên">Phú Yên</option><option value="Quảng Bình">Quảng Bình</option><option value="Quảng Nam">Quảng Nam</option><option value="Quảng Ngãi">Quảng Ngãi</option><option value="Quảng Ninh">Quảng Ninh</option><option value="Quảng Trị">Quảng Trị</option><option value="Sóc Trăng">Sóc Trăng</option><option value="Sơn La">Sơn La</option><option value="Tây Ninh">Tây Ninh</option><option value="Thái Bình">Thái Bình</option><option value="Thái Nguyên">Thái Nguyên</option><option value="Thanh Hóa">Thanh Hóa</option><option value="Thừa Thiên Huế">Thừa Thiên Huế</option><option value="Tiền Giang">Tiền Giang</option><option value="Trà Vinh">Trà Vinh</option><option value="Tuyên Quang">Tuyên Quang</option><option value="Vĩnh Long">Vĩnh Long</option><option value="Vĩnh Phúc">Vĩnh Phúc</option><option value="Yên Bái">Yên Bái</option>
																			</select>
																			<div id="cityVal"></div>
																		</div>
																	</div>
																</td>
															</tr>
															<tr>
																<td height="58" align="left" valign="top"><div style="float: left; width: 183px; height: 47px; margin-left: 0px; margin-top: 5px;">
																  <div class="text"  style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">Email:</div>
																  <div class="text" style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none; margin-top: 5px;">
																    <input name="Email" id="Email" type="text" style="width: 180px; height: 30px;" onkeydown="validateDiv('emailVal');" maxlength="300" />
																    <div id="emailVal"></div>
															      </div>
															    </div></td>
															</tr>
                                                  <tr>
                                                            	<td height="58" align="left" valign="top"><div style="float: left; width: 183px; height: 47px; margin-left: 0px; margin-top: 5px;">
                                                                	<div class="text"  style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">Số Tháng Muốn Vay:</div>
                                                                    <div class="text" style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none; margin-top: 5px;">
                                                                    	<input name="obligations" id="obligations"
                                                                                    onkeyup="intOnly(this);"
                                                                                    onkeypress="intOnly(this);" type="text"
                                                                                    style="width: 180px; height: 30px;" maxlength="10" />
                                                       	    	  </div>
                                                            	</div></td>
												  </tr>
                                                            </tbody>
                                                        </table></td>
                                                    <td width="50" align="left" valign="top">&nbsp;</td>
                                                    <td width="186" align="left" valign="top"><table
                                                            width="183" border="0" cellspacing="0" cellpadding="0">
                                                            <tbody>
                                                                <tr>
                                                                    <td height="58" align="left" valign="top"><div
                                                                            style="float: left; width: 183px; height: 47px; margin-left: 0px; margin-top: 5px;">
                                                                            <div class="text"
                                                                                style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">
                                                                                <span class="text"
                                                                                    style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">Nghề Nghiệp: </span>
                                                                            </div>
                                                                            <div class="text"
                                                                                style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none; margin-top: 5px;">
                                                                                <select name="Employment_Status"
                                                                                    id="Employment_Status"
                                                                                    onchange="validateDiv(&#39;empStatusVal&#39;);"
                                                                                    style="width: 180px; height: 30px; font-family: Verdana, Geneva, sans-serif; font-size: 11px; color: #4c4c4c;">
                                                                                    <option value="">Chọn Nghề Nghiệp</option>
                                                                                    <option value="Giám đốc">Giám đốc</option>
                                                                                    <option value="Kinh Doanh">Kinh Doanh</option>
                                                                                    <option value="Marketing">Marketing</option>
                                                                                </select>
                                                                                <div id="empStatusVal"></div>
                                                                            </div>
                                                                        </div></td>
                                                                </tr>
                                                                <tr>
                                                                    <td width="183" height="58" align="left" valign="top"><div
                                                                            style="float: left; width: 183px; height: 47px; margin-left: 0px; margin-top: 5px;">
                                                                            <div class="text"
                                                                                style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">Tổng Lương Hàng Tháng:</div>
                                                                            <div class="text"
                                                                                style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none; margin-top: 5px;">
                                                                                <input type="text" name="Net_Salary"
                                                                                    id="Net_Salary"
                                                                                    style="width: 180px; height: 30px;"
                                                                                    onkeyup="intOnly(this); getDigitToWords(&#39;Net_Salary&#39;,&#39;formatedIncome&#39;,&#39;wordIncome&#39;);"
                                                                                    onkeypress="intOnly(this);"
                                                                                    onblur="getDigitToWords(&#39;Net_Salary&#39;,&#39;formatedIncome&#39;,&#39;wordIncome&#39;);"
                                                                                    onchange="ShowHide(&#39;incomeShow&#39;,&#39;Net_Salary&#39;);"
                                                                                    onkeydown="validateDiv(&#39;netSalaryVal&#39;);" maxlength="20">
                                                                                    <div id="netSalaryVal"></div>
                                                                            </div>
                                                                        </div> <span id="formatedIncome"
                                                                        style="font-size: 11px; font-weight: normal; color: #ffffff; font-Family: Verdana;"></span>
                                                                        <span id="wordIncome"
                                                                        style="font-size: 11px; font-weight: normal; color: #ffffff; font-Family: Verdana; text-transform: capitalize;"></span></td>
                                                                </tr>
                                                            </tbody>
                                                        </table></td>
                                                    <td width="56" align="left" valign="top">&nbsp;</td>
                                                    <td width="214" align="left" valign="top"><table
                                                            width="183" border="0" cellspacing="0" cellpadding="0">

                                                            <tbody>
                                                                <tr>
                                                                    <td height="58" align="left" valign="top"><div
                                                                            style="float: left; width: 183px; height: 47px; margin-left: 0px; margin-top: 5px;">
                                                                            <div class="text"
                                                                                style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">Số Tiền Muốn Vay:</div>
                                                                            <div class="text"
                                                                                style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none; margin-top: 5px;">
                                                                                <input name="Loan_Amount" id="Loan_Amount"
                                                                                    maxlength="20" onkeypress="intOnly(this);"
                                                                                    onkeyup="intOnly(this); getDigitToWords(&#39;Loan_Amount&#39;,&#39;formatedlA&#39;,&#39;wordloanAmount&#39;);"
                                                                                    onblur="getDigitToWords(&#39;Loan_Amount&#39;,&#39;formatedlA&#39;,&#39;wordloanAmount&#39;);"
                                                                                    type="text" style="width: 180px; height: 30px;"
                                                                                    onkeydown="validateDiv(&#39;loanAmtVal&#39;);" />
                                                                                    <div id="loanAmtVal"></div>
                                                                            </div>
                                                                        </div>
                                                                        <span id="formatedlA"
                                                                        style="font-size: 11px; font-weight: normal; color: #ffffff; font-Family: Verdana;"></span><span
                                                                        id="wordloanAmount"
                                                                        style="font-size: 11px; font-weight: normal; color: #ffffff; font-Family: Verdana; text-transform: capitalize;"></span></td>
                                                                </tr>
                                                                <tr>
                                                                    <td height="58" align="left" valign="top"><div
                                                                            style="float: left; width: 183px; height: 47px; margin-left: 0px; margin-top: 5px;">
                                                                            <div class="text"
                                                                                style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none;">Giá Trị Tài Sản:</div>
                                                                            <div class="text"
                                                                                style="float: left; width: 180px; height: auto; color: #FFF; font-size: 12px; text-transform: none; margin-top: 5px;">
                                                                                <input name="property_value" id="property_value"
                                                                                    maxlength="20" onkeyup="intOnly(this);"
                                                                                    onkeypress="intOnly(this);" type="text"
                                                                                    style="width: 180px; height: 30px;"
                                                                                    onkeydown="validateDiv(&#39;propertyValueVal&#39;);">
                                                                                    <div id="propertyValueVal"></div>
                                                                            </div>
                                                                        </div></td>
                                                                </tr>
                                                                <tr>
                                                                    <td id="myDiv1"></td>
                                                                </tr>
                                                            </tbody>
                                                        </table></td>
                                                </tr>
                                                
                                                <tr>
                                                    <td height="40" colspan="9" align="left" valign="top">
                                                        <table width="912" border="0" cellpadding="0" cellspacing="0">
                                                            <tbody>
                                                                <tr>
                                                                    <td width="11" height="44" align="left" valign="top"
                                                                        class="text"
                                                                        style="float: left; height: auto; color: #FFF; font-size: 11px; text-transform: none; clear: right; margin-top: 7px;">&nbsp;</td>
                                                                    <td width="770" align="left" valign="top"
                                                                        class="text"
                                                                        style="float: left; width: 770px; height: auto; color: #FFF; font-size: 11px; text-transform: none; clear: right; margin-top: 0px;">
                                                                        <input name="accept" type="checkbox">
                                                                         Tôi
                                                                            cho phép bạn và các ngân hàng đối tác 
                                                                            liên hệ với tôi để giải thích các sản phẩm và tôi
                                                                            đồng ý với  và Điều khoản và Điều kiện .
                                                                           <div id="acceptVal"></div>
                                                                    </td>
                                                                    <td width="131" align="right" valign="top"><div
                                                                            style="float: right; width: 114px; height: 52px; margin-top: 0px; clear: right; margin-left: 0px;">
                                                                            <input type="submit" value="" style="border: 0px none; background-image: url(<?php echo($host) ?>images/get1.gif); width: 130px; height: 38px; margin-bottom: 0px; cursor: pointer;" />
                                                                        </div></td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="3" align="left" valign="top">
                                                                        <div id="hdfclife"></div>
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                </tr>

                                            </tbody>
									</table>
								</td>
							</tr>
							<tr>
								<td height="14" align="center" valign="top"><img src="<?php echo($host) ?>images/bgbottom1.jpg" width="960" height="14"></td>
							</tr>
						</tbody>
					</table>
				</td>
			</tr>
		</tbody>
	</table>
</form> <br>


<!---------------------------------------->

<div class="text" style="color: #4c4c4c; size: 18px; height: 37px; padding-left: 10px; clear:both">
        <span class="process_sec"><strong>Bước 2: Chọn thông tin thuộc tính theo nhu cầu (lãi suất được cập nhật theo bảng bên trên)</strong></span>
        
    </div>
    <div style="clear:both"></div>
<div class="hl_emi_process_box">
    <div style="border: #666666 1px solid; padding-left: 5px; background-color: #F8F8F8; margin-top: 10px;">
        <table border="0" cellpadding="3" cellspacing="2" width="95%" align="center">
            <tbody>
                <tr>
                    <td colspan="3" height="5"></td>
                </tr>
                <tr>
                    <td width="199" height="20" style="color: #333333; font-weight: bold; font-size: 13px; font-family: Arial, Helvetica, sans-serif;">Số Tiền Vay<span style="font-weight: normal;">&nbsp;&nbsp;&nbsp;</span>
                    </td>
                    <td width="72"><input type="test" value="0" name="amount_1a" id="amount_1a" size="11" onchange=" EMI_calc();" maxlength="11"></td>
                    <td width="266"></td>
                </tr>
                <tr>
                    <td colspan="3" height="25"><div id="slider_la" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">
                            <div class="ui-slider-range ui-widget-header ui-slider-range-min" style=""></div>
                            <a class="ui-slider-handle ui-state-default ui-corner-all" href="#" style="left: 5.084745762711865%;"></a>
                        </div>
                    </td>
                </tr>
                <tr>
                </tr>
                <tr>
                    <td colspan="3" height="20"></td>
                </tr>
                <tr>
                    <td height="20" style="color: #333333; font-weight: bold; font-size: 13px; font-family: Arial, Helvetica, sans-serif;">Lãi Suất</td>
                    <td><input type="test" value="0" name="amount_intr" id="amount_intr" size="11" onchange=" EMI_calc();" maxlength="6"></td>
                    <td style="color: #333333; font-weight: bold; font-size: 13px; font-family: Arial, Helvetica, sans-serif;">% Mỗi Năm</td>
                </tr>
                <tr>
                    <td colspan="3" height="25"><div id="slider_intr" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">
                            <div class="ui-slider-range ui-widget-header ui-slider-range-min" style=""></div>
                            <a class="ui-slider-handle ui-state-default ui-corner-all" href="#" style="left: 14.0625%;"></a>
                        </div>
                    </td>
                </tr>
                <tr>
                </tr>
                <tr>
                    <td colspan="3" height="20"></td>
                </tr>
                <tr>
                    <td height="20" style="color: #333333; font-weight: bold; font-size: 13px; font-family: Arial, Helvetica, sans-serif;">Năm Vay</td>
                    <td><input type="test" value="0" name="amount_lt" id="amount_lt" size="11" onchange=" EMI_calc();" maxlength="2"></td>
                    <td style="color: #333333; font-weight: bold; font-size: 13px; font-family: Arial, Helvetica, sans-serif;">Năm</td>
                </tr>
                <tr>
                    <td colspan="3" height="25"><div id="slider_lt" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">
                            <div class="ui-slider-range ui-widget-header ui-slider-range-min" style=""></div>
                            <a class="ui-slider-handle ui-state-default ui-corner-all" href="#" style="left: 50%;"></a>
                        </div>
                    </td>
                </tr>
                <tr>
                </tr>
            </tbody>
        </table>
    </div>
</div>

<div class="hl_emi_right_box">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tbody>
            <tr>
                <td valign="middle" class="text" style="color: #4c4c4c; size: 18px; height: 37px; padding-left: 20px;">Kết Quả Mẫu</td>
            </tr>
            <tr>
                <td><div class="emi_right_box">
                        <div style="float: left; width: 100%; background-color: #F8F8F8; padding-bottom: 0px;">
                            <div class="emi_sum_amount" style="background-color: #F8F8F8;">Số Tiền Vay</div>
                            <div class="emi_sum_value" id="loan_amt" style="background-color: #F8F8F8;"><span>15,000,000,000</span></div>
                            <div class="emi_sum_amount" style="background-color: #DADADA;">Thanh toán hàng tháng</div>
                            <div class="emi_sum_value" id="emi_monthly" style="background-color: #DADADA;"><span>237,430,184</span></div>
                            <div class="emi_sum_amount" style="background-color: #F8F8F8;">Tổng số tiền lãi</div>
                            <div class="emi_sum_value" id="total_intr" style="background-color: #F8F8F8;"><span>13,491,622,092</span></div>
                            <div class="emi_sum_amount" style="background-color: #DADADA;">Tổng số tiền (gốc + lãi)</div>
                            <div class="emi_sum_value" style="background-color: #DADADA;" id="total_amt"><span>28,491,622,092</span></div>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="center"><div id="container" style="height: 200px;" data-highcharts-chart="0">
                        <div class="highcharts-container" id="highcharts-0" style="position: relative; overflow: hidden; width: 200px; height: 200px; text-align: left; line-height: normal; z-index: 0; font-family: &amp; amp; #39; Lucida Grande&amp;amp; #39; , &amp; amp; #39; Lucida Sans Unicode&amp;amp; #39; , Verdana , Arial, Helvetica, sans-serif; font-size: 12px;">
                            <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
                                width="200" height="200"> <defs> <clippath
                                id="highcharts-1"> <rect rx="0" ry="0" fill="none"
                                x="0" y="0" width="9999" height="200" stroke-width="0.000001"></rect></clippath>
                            <clippath id="highcharts-2"> <rect fill="none"
                                x="0" y="0" width="180" height="122"></rect></clippath></defs> <rect rx="5"
                                ry="5" fill="#FFFFFF" x="0" y="0" width="200" height="200"
                                stroke-width="0.000001"></rect> <g
                                class="highcharts-series-group" zIndex="3"></g> <g
                                class="highcharts-shadow" zIndex="4"
                                transform="translate(10,10)"> <path fill="none"
                                d="M 89.99068195093095 15.250000948918462 A 45.75 45.75 0 1 1 44.33905896929119 58.14676250723285 L 90 61 A 0 0 0 1 0 90 61 Z"
                                stroke="black" stroke-width="5" stroke-linejoin="round"
                                isShadow="true" stroke-opacity="0.049999999999999996"
                                transform="translate(1, 1)" x="90" y="61"></path> <path
                                fill="none"
                                d="M 89.99068195093095 15.250000948918462 A 45.75 45.75 0 1 1 44.33905896929119 58.14676250723285 L 90 61 A 0 0 0 1 0 90 61 Z"
                                stroke="black" stroke-width="3" stroke-linejoin="round"
                                isShadow="true" stroke-opacity="0.09999999999999999"
                                transform="translate(1, 1)" x="90" y="61"></path> <path
                                fill="none"
                                d="M 89.99068195093095 15.250000948918462 A 45.75 45.75 0 1 1 44.33905896929119 58.14676250723285 L 90 61 A 0 0 0 1 0 90 61 Z"
                                stroke="black" stroke-width="1" stroke-linejoin="round"
                                isShadow="true" stroke-opacity="0.15"
                                transform="translate(1, 1)" x="90" y="61"></path></g> <g
                                class="highcharts-shadow" zIndex="4"
                                transform="translate(3,3)"> <path fill="none"
                                d="M 44.33906182255151 58.14671684629324 A 45.75 45.75 0 0 1 89.98215839785266 15.25000347893748 L 90 61 A 0 0 0 0 0 90 61 Z"
                                stroke="black" stroke-width="5" stroke-linejoin="round"
                                isShadow="true" stroke-opacity="0.049999999999999996"
                                transform="translate(1, 1)" x="90" y="61"></path> <path
                                fill="none"
                                d="M 44.33906182255151 58.14671684629324 A 45.75 45.75 0 0 1 89.98215839785266 15.25000347893748 L 90 61 A 0 0 0 0 0 90 61 Z"
                                stroke="black" stroke-width="3" stroke-linejoin="round"
                                isShadow="true" stroke-opacity="0.09999999999999999"
                                transform="translate(1, 1)" x="90" y="61"></path> <path
                                fill="none"
                                d="M 44.33906182255151 58.14671684629324 A 45.75 45.75 0 0 1 89.98215839785266 15.25000347893748 L 90 61 A 0 0 0 0 0 90 61 Z"
                                stroke="black" stroke-width="1" stroke-linejoin="round"
                                isShadow="true" stroke-opacity="0.15"
                                transform="translate(1, 1)" x="90" y="61"></path></g> <g
                                class="highcharts-point" zIndex="5"
                                transform="translate(10,10)"> <path fill="#4572A7"
                                d="M 89.99068195093095 15.250000948918462 A 45.75 45.75 0 1 1 44.33905896929119 58.14676250723285 L 90 61 A 0 0 0 1 0 90 61 Z"
                                stroke="#FFFFFF" stroke-width="1" stroke-linejoin="round"></path>
                            <path fill="rgb(192,192,192)"
                                d="M 89.99068195093095 15.250000948918462 A 45.75 45.75 0 1 1 44.33905896929119 58.14676250723285 L 90 61 A 0 0 0 1 0 90 61 Z"
                                isTracker="1366707971819" fill-opacity="0.0001"
                                visibility="visible" style="cursor:pointer;"></path></g> <g
                                class="highcharts-point" zIndex="5"
                                transform="translate(3,3)"> <path fill="#AA4643"
                                d="M 44.33906182255151 58.14671684629324 A 45.75 45.75 0 0 1 89.98215839785266 15.25000347893748 L 90 61 A 0 0 0 0 0 90 61 Z"
                                stroke="#FFFFFF" stroke-width="1" stroke-linejoin="round"></path>
                            <path fill="rgb(192,192,192)"
                                d="M 44.33906182255151 58.14671684629324 A 45.75 45.75 0 0 1 89.98215839785266 15.25000347893748 L 90 61 A 0 0 0 0 0 90 61 Z"
                                isTracker="1366707971819" fill-opacity="0.0001"
                                visibility="visible" style="cursor:pointer;"></path></g> <g
                                class="highcharts-legend" zIndex="7"
                                transform="translate(18,142)"> <rect rx="5" ry="5"
                                fill="none" x="0.5" y="0.5" width="164" height="42"
                                stroke-width="1" stroke="#909090" visibility="visible"></rect>
                            <g zIndex="1" clip-path="url(#highcharts-1)"> <g> <g
                                class="highcharts-legend-item" zIndex="1"
                                transform="translate(8,3)"> <text x="21" y="15"
                                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:12px;cursor:pointer;color:#3E576F;fill:#3E576F;"
                                text-anchor="start" zIndex="2"> <tspan x="21">Tổng Vay</tspan></text> <rect rx="2" ry="2" fill="#4572A7" x="0" y="4"
                                width="16" height="12" stroke-width="0.000001" zIndex="3"
                                stroke="#4572A7"></rect></g> <g class="highcharts-legend-item"
                                zIndex="1" transform="translate(8,19)"> <text x="21"
                                y="15"
                                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:12px;cursor:pointer;color:#3E576F;fill:#3E576F;"
                                text-anchor="start" zIndex="2"> <tspan x="21">Tổng Lãi</tspan></text> <rect rx="2" ry="2" fill="#AA4643" x="0" y="4"
                                width="16" height="12" stroke-width="0.000001" zIndex="3"
                                stroke="#AA4643"></rect></g></g></g></g> <g class="highcharts-tooltip"
                                zIndex="8" style="padding:0;white-space:nowrap;"
                                visibility="hidden"> <rect rx="5" ry="5" fill="none"
                                x="0" y="0" width="10" height="10" stroke-width="5"
                                fill-opacity="0.85" isShadow="true" stroke="black"
                                stroke-opacity="0.049999999999999996"
                                transform="translate(1, 1)"></rect> <rect rx="5" ry="5"
                                fill="none" x="0" y="0" width="10" height="10"
                                stroke-width="3" fill-opacity="0.85" isShadow="true"
                                stroke="black" stroke-opacity="0.09999999999999999"
                                transform="translate(1, 1)"></rect> <rect rx="5" ry="5"
                                fill="none" x="0" y="0" width="10" height="10"
                                stroke-width="1" fill-opacity="0.85" isShadow="true"
                                stroke="black" stroke-opacity="0.15"
                                transform="translate(1, 1)"></rect> <rect rx="5" ry="5"
                                fill="rgb(255,255,255)" x="0" y="0" width="10" height="10"
                                stroke-width="2" fill-opacity="0.85"></rect> <text x="5"
                                y="18"
                                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:12px;color:#333333;fill:#333333;"
                                zIndex="1"></text></g> <text x="190" y="195"
                                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:10px;cursor:pointer;color:#909090;fill:#909090;"
                                text-anchor="end" zIndex="8"></text> <g
                                class="highcharts-tracker" zIndex="9"></g></svg>
                        </div>
                    </div></td>
            </tr>
        </tbody>
    </table>
</div>

<div style="clear: both;"></div>
<div class="hl_emi_chart">
    <div id="barChart" data-highcharts-chart="1">
        <div class="highcharts-container" id="highcharts-3"
            style="position: relative; overflow: hidden; width: 623px; height: 300px; text-align: left; line-height: normal; z-index: 0; font-family: &amp; amp; #39; Lucida Grande&amp; #39; , &amp; amp; #39; Lucida Sans Unicode&amp; #39; , Verdana , Arial, Helvetica, sans-serif; font-size: 12px;">
            <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="623"
                height="300"> <defs> <clippath id="highcharts-4">
            <rect rx="0" ry="0" fill="none" x="0" y="0" width="9999"
                height="300" stroke-width="0.000001"></rect></clippath> <clippath
                id="highcharts-5"> <rect fill="none" x="0" y="0"
                width="202" height="558"></rect></clippath></defs> <rect rx="5" ry="5"
                fill="#FFFFFF" x="0" y="0" width="623" height="300"
                stroke-width="0.000001"></rect> <g class="highcharts-grid"
                zIndex="1"></g> <g class="highcharts-grid" zIndex="1"> <path
                fill="none" d="M 134.5 10 L 134.5 212" stroke="#C0C0C0"
                stroke-width="1" zIndex="1"></path> <path fill="none"
                d="M 213.5 10 L 213.5 212" stroke="#C0C0C0" stroke-width="1"
                zIndex="1"></path> <path fill="none" d="M 293.5 10 L 293.5 212"
                stroke="#C0C0C0" stroke-width="1" zIndex="1"></path> <path
                fill="none" d="M 373.5 10 L 373.5 212" stroke="#C0C0C0"
                stroke-width="1" zIndex="1"></path> <path fill="none"
                d="M 453.5 10 L 453.5 212" stroke="#C0C0C0" stroke-width="1"
                zIndex="1"></path> <path fill="none" d="M 532.5 10 L 532.5 212"
                stroke="#C0C0C0" stroke-width="1" zIndex="1"></path> <path
                fill="none" d="M 612.5 10 L 612.5 212" stroke="#C0C0C0"
                stroke-width="1" zIndex="1"></path> <path fill="none"
                d="M 54.5 10 L 54.5 212" stroke="#C0C0C0" stroke-width="1"
                zIndex="1"></path></g> <g class="highcharts-axis" zIndex="2"> <path
                fill="none" d="M 55 111.5 L 50 111.5" stroke="#C0D0E0"
                stroke-width="1"></path> <path fill="none"
                d="M 55 162.5 L 50 162.5" stroke="#C0D0E0" stroke-width="1"></path>
            <path fill="none" d="M 55 212.5 L 50 212.5" stroke="#C0D0E0"
                stroke-width="1"></path> <path fill="none"
                d="M 55 61.5 L 50 61.5" stroke="#C0D0E0" stroke-width="1"></path>
            <path fill="none" d="M 54.5 10 L 54.5 212" stroke="#C0D0E0"
                stroke-width="1" zIndex="7" visibility="visible"></path></g> <g
                class="highcharts-axis" zIndex="2"> <text x="334" y="244"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:12px;color:#6D869F;font-weight:bold;fill:#6D869F;"
                zIndex="7" text-anchor="middle" visibility="visible"> <tspan
                x="334">Gốc + Lãi</tspan></text></g> <g
                class="highcharts-series-group" zIndex="3"> <g
                class="highcharts-series" visibility="visible" zIndex="0.1"
                transform="translate(613,212) rotate(90) scale(-1,1)" width="558"
                height="202" clip-path="url(#highcharts-5)"> <rect
                fill="none" x="164.5" y="30.5" width="24" height="312"
                stroke-width="5" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.049999999999999996"
                transform="translate(-1,-1)"></rect> <rect fill="none" x="164.5"
                y="30.5" width="24" height="314" stroke-width="3" stroke="black"
                rx="0" ry="0" isShadow="true"
                stroke-opacity="0.09999999999999999" transform="translate(-1,-1)"></rect>
            <rect fill="none" x="164.5" y="30.5" width="24" height="316"
                stroke-width="1" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.15" transform="translate(-1,-1)"></rect> <rect
                fill="#4572A7" x="164.5" y="30.5" width="24" height="317"
                stroke-width="1" stroke="#FFFFFF" rx="0" ry="0"></rect> <rect
                fill="none" x="114.5" y="30.5" width="24" height="361"
                stroke-width="5" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.049999999999999996"
                transform="translate(-1,-1)"></rect> <rect fill="none" x="114.5"
                y="30.5" width="24" height="363" stroke-width="3" stroke="black"
                rx="0" ry="0" isShadow="true"
                stroke-opacity="0.09999999999999999" transform="translate(-1,-1)"></rect>
            <rect fill="none" x="114.5" y="30.5" width="24" height="365"
                stroke-width="1" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.15" transform="translate(-1,-1)"></rect> <rect
                fill="#4572A7" x="114.5" y="30.5" width="24" height="366"
                stroke-width="1" stroke="#FFFFFF" rx="0" ry="0"></rect> <rect
                fill="none" x="63.5" y="30.5" width="24" height="418"
                stroke-width="5" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.049999999999999996"
                transform="translate(-1,-1)"></rect> <rect fill="none" x="63.5"
                y="30.5" width="24" height="420" stroke-width="3" stroke="black"
                rx="0" ry="0" isShadow="true"
                stroke-opacity="0.09999999999999999" transform="translate(-1,-1)"></rect>
            <rect fill="none" x="63.5" y="30.5" width="24" height="422"
                stroke-width="1" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.15" transform="translate(-1,-1)"></rect> <rect
                fill="#4572A7" x="63.5" y="30.5" width="24" height="423"
                stroke-width="1" stroke="#FFFFFF" rx="0" ry="0"></rect> <rect
                fill="none" x="13.5" y="30.5" width="24" height="483"
                stroke-width="5" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.049999999999999996"
                transform="translate(-1,-1)"></rect> <rect fill="none" x="13.5"
                y="30.5" width="24" height="485" stroke-width="3" stroke="black"
                rx="0" ry="0" isShadow="true"
                stroke-opacity="0.09999999999999999" transform="translate(-1,-1)"></rect>
            <rect fill="none" x="13.5" y="30.5" width="24" height="487"
                stroke-width="1" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.15" transform="translate(-1,-1)"></rect> <rect
                fill="#4572A7" x="13.5" y="30.5" width="24" height="488"
                stroke-width="1" stroke="#FFFFFF" rx="0" ry="0"></rect></g> <g
                class="highcharts-markers" visibility="visible" zIndex="0.1"
                transform="translate(613,212) rotate(90) scale(-1,1)" width="558"
                height="202"></g> <g class="highcharts-series"
                visibility="visible" zIndex="0.1"
                transform="translate(613,212) rotate(90) scale(-1,1)" width="558"
                height="202" clip-path="url(#highcharts-5)"> <rect
                fill="none" x="164.5" y="347.5" width="24" height="205"
                stroke-width="5" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.049999999999999996"
                transform="translate(-1,-1)"></rect> <rect fill="none" x="164.5"
                y="347.5" width="24" height="207" stroke-width="3" stroke="black"
                rx="0" ry="0" isShadow="true"
                stroke-opacity="0.09999999999999999" transform="translate(-1,-1)"></rect>
            <rect fill="none" x="164.5" y="347.5" width="24" height="209"
                stroke-width="1" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.15" transform="translate(-1,-1)"></rect> <rect
                fill="#AA4643" x="164.5" y="347.5" width="24" height="210"
                stroke-width="1" stroke="#FFFFFF" rx="0" ry="0"></rect> <rect
                fill="none" x="114.5" y="396.5" width="24" height="156"
                stroke-width="5" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.049999999999999996"
                transform="translate(-1,-1)"></rect> <rect fill="none" x="114.5"
                y="396.5" width="24" height="158" stroke-width="3" stroke="black"
                rx="0" ry="0" isShadow="true"
                stroke-opacity="0.09999999999999999" transform="translate(-1,-1)"></rect>
            <rect fill="none" x="114.5" y="396.5" width="24" height="160"
                stroke-width="1" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.15" transform="translate(-1,-1)"></rect> <rect
                fill="#AA4643" x="114.5" y="396.5" width="24" height="161"
                stroke-width="1" stroke="#FFFFFF" rx="0" ry="0"></rect> <rect
                fill="none" x="63.5" y="453.5" width="24" height="99"
                stroke-width="5" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.049999999999999996"
                transform="translate(-1,-1)"></rect> <rect fill="none" x="63.5"
                y="453.5" width="24" height="101" stroke-width="3" stroke="black"
                rx="0" ry="0" isShadow="true"
                stroke-opacity="0.09999999999999999" transform="translate(-1,-1)"></rect>
            <rect fill="none" x="63.5" y="453.5" width="24" height="103"
                stroke-width="1" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.15" transform="translate(-1,-1)"></rect> <rect
                fill="#AA4643" x="63.5" y="453.5" width="24" height="104"
                stroke-width="1" stroke="#FFFFFF" rx="0" ry="0"></rect> <rect
                fill="none" x="13.5" y="518.5" width="24" height="34"
                stroke-width="5" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.049999999999999996"
                transform="translate(-1,-1)"></rect> <rect fill="none" x="13.5"
                y="518.5" width="24" height="36" stroke-width="3" stroke="black"
                rx="0" ry="0" isShadow="true"
                stroke-opacity="0.09999999999999999" transform="translate(-1,-1)"></rect>
            <rect fill="none" x="13.5" y="518.5" width="24" height="38"
                stroke-width="1" stroke="black" rx="0" ry="0" isShadow="true"
                stroke-opacity="0.15" transform="translate(-1,-1)"></rect> <rect
                fill="#AA4643" x="13.5" y="518.5" width="24" height="39"
                stroke-width="1" stroke="#FFFFFF" rx="0" ry="0"></rect></g> <g
                class="highcharts-markers" visibility="visible" zIndex="0.1"
                transform="translate(613,212) rotate(90) scale(-1,1)" width="558"
                height="202"></g></g> <g class="highcharts-legend" zIndex="7"
                transform="translate(233,258)"> <rect rx="5" ry="5"
                fill="#FFFFFF" x="0.5" y="0.5" width="157" height="26"
                stroke-width="1" stroke="#909090" visibility="visible"></rect> <g
                zIndex="1" clip-path="url(#highcharts-4)"> <g> <g
                class="highcharts-legend-item" zIndex="1"
                transform="translate(8,3)"> <text x="21" y="15"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:12px;cursor:pointer;color:#3E576F;fill:#3E576F;"
                text-anchor="start" zIndex="2"> <tspan x="21">Lãi</tspan></text>
            <rect rx="2" ry="2" fill="#AA4643" x="0" y="4" width="16"
                height="12" stroke-width="0.000001" zIndex="3" stroke="#AA4643"></rect></g>
            <g class="highcharts-legend-item" zIndex="1"
                transform="translate(80,3)"> <text x="21" y="15"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:12px;cursor:pointer;color:#3E576F;fill:#3E576F;"
                text-anchor="start" zIndex="2"> <tspan x="21">Gốc</tspan></text>
            <rect rx="2" ry="2" fill="#4572A7" x="0" y="4" width="16"
                height="12" stroke-width="0.000001" zIndex="3" stroke="#4572A7"></rect></g></g></g></g>
            <g class="highcharts-axis-labels" zIndex="7"> <text x="47"
                y="33.86110061804701"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;width:259px;color:#666;line-height:14px;fill:#666;"
                text-anchor="end" transform="rotate(-25 47 33)"> <tspan
                x="47">Năm 1</tspan></text> <text x="47" y="84.361100618047"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;width:259px;color:#666;line-height:14px;fill:#666;"
                text-anchor="end" transform="rotate(-25 47 84)"> <tspan
                x="47">Năm 2</tspan></text> <text x="47" y="134.861100618047"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;width:259px;color:#666;line-height:14px;fill:#666;"
                text-anchor="end" transform="rotate(-25 47 134)"> <tspan
                x="47">Năm 3</tspan></text> <text x="47" y="185.361100618047"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;width:259px;color:#666;line-height:14px;fill:#666;"
                text-anchor="end" transform="rotate(-25 47 185)"> <tspan
                x="47">Năm 4</tspan></text></g> <g class="highcharts-axis-labels"
                zIndex="7"> <text x="55" y="226"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;color:#666;line-height:14px;fill:#666;"
                text-anchor="middle"> <tspan x="55">0k</tspan></text> <text
                x="134.71428571428572" y="226"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;color:#666;line-height:14px;fill:#666;"
                text-anchor="middle"> <tspan x="134.71428571428572">10k</tspan></text>
            <text x="214.42857142857144" y="226"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;color:#666;line-height:14px;fill:#666;"
                text-anchor="middle"> <tspan x="214.42857142857144">20k</tspan></text>
            <text x="294.14285714285717" y="226"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;color:#666;line-height:14px;fill:#666;"
                text-anchor="middle"> <tspan x="294.14285714285717">30k</tspan></text>
            <text x="373.8571428571429" y="226"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;color:#666;line-height:14px;fill:#666;"
                text-anchor="middle"> <tspan x="373.8571428571429">40k</tspan></text>
            <text x="453.5714285714286" y="226"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;color:#666;line-height:14px;fill:#666;"
                text-anchor="middle"> <tspan x="453.5714285714286">50k</tspan></text>
            <text x="533.2857142857143" y="226"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;color:#666;line-height:14px;fill:#666;"
                text-anchor="middle"> <tspan x="533.2857142857143">60k</tspan></text>
            <text x="613" y="226"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:11px;color:#666;line-height:14px;fill:#666;"
                text-anchor="middle"> <tspan x="613">70k</tspan></text></g> <g
                class="highcharts-tooltip" zIndex="8"
                style="padding:0;white-space:nowrap;" visibility="hidden"> <rect
                rx="5" ry="5" fill="none" x="0" y="0" width="10" height="10"
                stroke-width="5" fill-opacity="0.85" isShadow="true"
                stroke="black" stroke-opacity="0.049999999999999996"
                transform="translate(1, 1)"></rect> <rect rx="5" ry="5"
                fill="none" x="0" y="0" width="10" height="10" stroke-width="3"
                fill-opacity="0.85" isShadow="true" stroke="black"
                stroke-opacity="0.09999999999999999" transform="translate(1, 1)"></rect>
            <rect rx="5" ry="5" fill="none" x="0" y="0" width="10" height="10"
                stroke-width="1" fill-opacity="0.85" isShadow="true"
                stroke="black" stroke-opacity="0.15" transform="translate(1, 1)"></rect>
            <rect rx="5" ry="5" fill="rgb(255,255,255)" x="0" y="0" width="10"
                height="10" stroke-width="2" fill-opacity="0.85"></rect> <text
                x="5" y="18"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:12px;color:#333333;fill:#333333;"
                zIndex="1"></text></g> <text x="613" y="295"
                style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Verdana, Arial, Helvetica, sans-serif;font-size:10px;cursor:pointer;color:#909090;fill:#909090;"
                text-anchor="end" zIndex="8"></text> <g
                class="highcharts-tracker" zIndex="9"> <g
                visibility="visible" zIndex="1"
                transform="translate(613,212) rotate(90) scale(-1,1)" width="558"
                height="202" clip-path="url(#highcharts-5)"> <rect
                fill="rgb(192,192,192)" x="13.5" y="30.5" width="24" height="488"
                isTracker="1366707972030" fill-opacity="0.0001"
                visibility="visible" style=""></rect> <rect
                fill="rgb(192,192,192)" x="63.5" y="30.5" width="24" height="423"
                isTracker="1366707972030" fill-opacity="0.0001"
                visibility="visible" style=""></rect> <rect
                fill="rgb(192,192,192)" x="114.5" y="30.5" width="24"
                height="366" isTracker="1366707972030" fill-opacity="0.0001"
                visibility="visible" style=""></rect> <rect
                fill="rgb(192,192,192)" x="164.5" y="30.5" width="24"
                height="317" isTracker="1366707972030" fill-opacity="0.0001"
                visibility="visible" style=""></rect></g> <g visibility="visible"
                zIndex="1" transform="translate(613,212) rotate(90) scale(-1,1)"
                width="558" height="202" clip-path="url(#highcharts-5)"> <rect
                fill="rgb(192,192,192)" x="13.5" y="518.5" width="24" height="39"
                isTracker="1366707972056" fill-opacity="0.0001"
                visibility="visible" style=""></rect> <rect
                fill="rgb(192,192,192)" x="63.5" y="453.5" width="24"
                height="104" isTracker="1366707972056" fill-opacity="0.0001"
                visibility="visible" style=""></rect> <rect
                fill="rgb(192,192,192)" x="114.5" y="396.5" width="24"
                height="161" isTracker="1366707972056" fill-opacity="0.0001"
                visibility="visible" style=""></rect> <rect
                fill="rgb(192,192,192)" x="164.5" y="347.5" width="24"
                height="210" isTracker="1366707972056" fill-opacity="0.0001"
                visibility="visible" style=""></rect></g></g></svg>
        </div>
    </div>
</div>

<div class="hl_emi_tbl_dis">
    <div id="tblpaymentsDetails">
        <table id="pmtTab"
            style="clear: both; background: none repeat scroll 0 0 #FCFCFC; margin: 0 0 20px 0; text-align: center;">
            <tbody>
                <tr>
                    <td height="20"
                        style="border: 1px solid #DBDAD7; background: #4572A7; border-top: 0; width: 90px; font: 12px Arial, Helvetica, sans-serif; color: #FFFFFF;"
                        id="numHead">Năm</td>
                    <td height="20"
                        style="border: 1px solid #DBDAD7; background: #4572A7; border-top: 0; width: 110px; font: 12px Arial, Helvetica, sans-serif; color: #FFFFFF;"
                        id="oldBal">Gốc</td>

                    <td align="center"
                        style="border: 1px solid #DBDAD7; background: #4572A7; border-top: 0; width: 110px; font: 12px Arial, Helvetica, sans-serif; color: #FFFFFF;"
                        id="pt">Lãi</td>
                    <td
                        style="border: 1px solid #DBDAD7; background: #4572A7; border-top: 0; width: 210px; font: 12px Arial, Helvetica, sans-serif; color: #FFFFFF;"
                        id="oil">Gốc còn lại</td>
                </tr>
                <tr height="18">
                    <td height="18" align="center" width="64" class="default_td">1</td>
                    <td align="center" width="64" class="default_td">39,766</td>
                    <td align="center" width="64" class="default_td">26,426</td>
                    <td align="center" width="64" class="default_td">1,60,234</td>
                </tr>
                <tr height="18">
                    <td height="18" align="center" width="64" class="default_td">2</td>
                    <td align="center" width="64" class="default_td">45,930</td>
                    <td align="center" width="64" class="default_td">20,262</td>
                    <td align="center" width="64" class="default_td">1,14,304</td>
                </tr>
                <tr height="18">
                    <td height="18" align="center" width="64" class="default_td">3</td>
                    <td align="center" width="64" class="default_td">53,054</td>
                    <td align="center" width="64" class="default_td">13,138</td>
                    <td align="center" width="64" class="default_td">61,250</td>
                </tr>
                <tr height="18">
                    <td height="18" align="center" width="64" class="default_td">4</td>
                    <td align="center" width="64" class="default_td">61,316</td>
                    <td align="center" width="64" class="default_td">4,914</td>
                    <td align="center" width="64" class="default_td">0</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<div style="clear: both;"></div>
<div class="pl_emi_cal_table" style="margin-top: 15px;">
    <table
        style="clear: both; background: none repeat scroll 0 0 #FCFCFC; margin: 0 0 20px 0; text-align: center;"
        width="100%">
        <tbody>
            <tr>
                <td height="20" style="border: 1px solid #DBDAD7; background: #4572A7; border-top: 0; width: 150px; font: 12px Arial, Helvetica, sans-serif; color: #FFFFFF;">Tên Ngân Hàng</td>
                <td align="center" style="border: 1px solid #DBDAD7; background: #4572A7; border-top: 0; width: 150px; font: 12px Arial, Helvetica, sans-serif; color: #FFFFFF;">Lãi Suất</td>
                <td style="border: 1px solid #DBDAD7; background: #4572A7; border-top: 0; width: 210px; font: 12px Arial, Helvetica, sans-serif; color: #FFFFFF;"><div id="intr_text" align="center"><span style="width: 170px;" align="center">Thanh toán hàng tháng</span></div></td>
            </tr>
            <?php
			foreach($ratedatebasic as $entry) {
				$entry[0] = preg_replace('/[\s]+/','',$entry[0]);
			?>
            <tr height="18">
                <td height="18" align="center" class="default_td"><?php echo($entry[1]) ?> (<?php echo($entry[0]) ?>)</td>
                <td align="center" class="default_td"><?php echo($entry[2]) ?>% - <?php echo($entry[3]) ?>%</td>
                <td align="center" class="default_td"><div id="<?php echo($entry[0]) ?>_bnk"><span></span></div></td>
            </tr>
			<?php
            }
            ?>
            <!--<tr height="18">
                <td height="18" align="center" class="default_td">HDFC Bank</td>
                <td align="center" class="default_td">13.99% - 22.25%</td>
                <td align="center" class="default_td"><div id="hdfc_bnk"><span>5,464 - 6,328</span></div></td>
            </tr>
            <tr height="18">
                <td height="18" align="center" class="default_td">ICICI Bank</td>
                <td align="center" class="default_td">14% - 18.5%</td>
                <td align="center" class="default_td"><div id="icici_bnk"><span>5,465 - 5,927</span></div></td>
            </tr>
            <tr height="18">
                <td height="18" align="center" class="default_td">Bajaj Finserv</td>
                <td align="center" class="default_td">15.75% - 17%</td>
                <td align="center" class="default_td"><div id="bajaj_bnk"><span>5,642 - 5,771</span></div></td>
            </tr>
            <tr height="18">
                <td height="18" align="center" class="default_td">ING Vysya</td>
                <td align="center" class="default_td">14.50% - 18.25%</td>
                <td align="center" class="default_td"><div id="ing_bnk"><span>5,515 - 5,901</span></div></td>
            </tr>-->
    
        </tbody>
    </table>

</div>
<div style="clear: both;"></div>
<div class="pl_emi_cal_text">
	<?php 
	if(count($intro) == 1) {
	?>
    <div class="text11" style="color: #4c4c4c; width: 950px; margin-left: 8px; margin-top: 10px;"><?php echo($intro[0][1]) ?></div>
    <?php
	}
	?>
</div>
<div style="clear: both;"></div>

</div>


<script>
function chkform()
{
	var regMail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/
	var j;
	var cnt=-1;
	var alpha=/^[a-zA-Z\ ]*$/;
	var alphanum=/^[a-zA-Z0-9]*$/;
	var num=/^[0-9]*$/;
	var space=/^[\ ]*$/;
	var iChars ="/@#$%^&*()+=-[]\\\';,.{}|\":<>?!";

//kiem tra ho ten
	if((document.loan_form.Name.value=="") || (Trim(document.loan_form.Name.value))==false)
	{
        document.getElementById('nameVal').innerHTML = "<span  class='hintanchor'>Vui Lòng Nhập Họ Tên</span>";		
		document.loan_form.Name.focus();
		return false;
	}

	if(document.loan_form.Name.value!="")
	{
		if(containsdigit(document.loan_form.Name.value)==true)
		{
			document.getElementById('nameVal').innerHTML = "<span  class='hintanchor'>Họ Tên không được chứa số!</span>";
			document.loan_form.Name.focus();
			return false;
		}
	}
   for (var i = 0; i <document.loan_form.Name.value.length; i++) 
   {
		if (iChars.indexOf(document.loan_form.Name.value.charAt(i)) != -1) 
		{
			document.getElementById('nameVal').innerHTML = "<span  class='hintanchor'>Không được chứa ký tự đặc biệt!</span>";
			document.loan_form.Name.focus();
			return false;
		}
  }
		
	// kiem tra ngay thang nam sinh
	if($('#birthday').val() == "") {
		//document.getElementById('dobVal').innerHTML = "<span  class='hintanchor'>Nhập ngày tháng năm sinh!</span>";
		$('#birthday').focus();
		return false;
	}
	
	// kiem tra so dien thoai
	if(document.loan_form.Phone.value=="")
	{
		document.getElementById('phoneVal').innerHTML = "<span  class='hintanchor'>Nhập số điện thoại!</span>";
		document.loan_form.Phone.focus();
		return false;
	}
	if(isNaN(document.loan_form.Phone.value)|| document.loan_form.Phone.value.indexOf(" ")!=-1)
	{
		document.getElementById('phoneVal').innerHTML = "<span  class='hintanchor'>Chỉ được nhập số!</span>";
		document.loan_form.Phone.focus();
		return false;  
	}
	if (document.loan_form.Phone.value.length < 9 )
	{
	  	document.getElementById('phoneVal').innerHTML = "<span  class='hintanchor'>SĐT lớn hơn 9 số!</span>";	
		document.loan_form.Phone.focus();
		return false;
	}
	
	//kiem tra tinh thanh
	if (document.loan_form.City.selectedIndex==0)
	{
		document.getElementById('cityVal').innerHTML = "<span  class='hintanchor'>Enter City to Continue!</span>";	
		document.loan_form.City.focus();
		return false;
	}
		
	// kiem tra nhap email
	if(document.loan_form.Email.value=="")
	{
		document.getElementById('emailVal').innerHTML = "<span  class='hintanchor'>Nhập địa chỉ email!</span>";	
		document.loan_form.Email.focus();
		return false;
	}
	
	var str=document.loan_form.Email.value
	var aa=str.indexOf("@")
	var bb=str.indexOf(".")
	var cc=str.charAt(aa)

	if(aa==-1)
	{
		document.getElementById('emailVal').innerHTML = "<span  class='hintanchor'>Email không hợp lệ!</span>";	
		document.loan_form.Email.focus();
		return false;
	}
	else if(bb==-1)
	{
		document.getElementById('emailVal').innerHTML = "<span  class='hintanchor'>Email không hợp lệ!</span>";	
		document.loan_form.Email.focus();
		return false;
	}


// kiem tra da chon nghe nghe chua
	if (document.loan_form.Employment_Status.selectedIndex==0)
	{
		document.getElementById('empStatusVal').innerHTML = "<span  class='hintanchor'>Vui lòng chọn nghề nghiệp!</span>";	
		document.loan_form.Employment_Status.focus();
		return false;
	}

// kiem tra tong luong hang nam
	if (document.loan_form.Net_Salary.value=="")
	{
		document.getElementById('netSalaryVal').innerHTML = "<span  class='hintanchor'>Vui lòng nhập tổng lương hàng năm!</span>";	
		document.loan_form.Net_Salary.focus();
		return false;
	}

// kiem tra so tien muon vay
	if (document.loan_form.Loan_Amount.value=="")
	{
		document.getElementById('loanAmtVal').innerHTML = "<span  class='hintanchor'>Vui lòng nhập số tiền muốn vay!</span>";	
		document.loan_form.Loan_Amount.focus();
		return false;
	}	
	

// kiem tra accept
	if(!document.loan_form.accept.checked)
	{
		document.getElementById('acceptVal').innerHTML = "<span  class='hintanchor'>Chấp nhận các Điều khoản và Điều kiện!</span>";

		document.loan_form.accept.focus();
		return false;
	}	
	
	
	insertajax();
	return false;
}
//----------------------------------------------------
function insertajax() {
	var fullname = $('#Name').val();
	var phonenumber = $('#Phone').val();
	var emailadd = $('#Email').val();
	var contry = $('#City').val();
	var salary = $('#Net_Salary').val();
	var ngsinh = $('#birthday').val();
	var employment = $('#Employment_Status').val();
	var amount = $('#Loan_Amount').val();
	var giatritaisan = $('#property_value').val();
	var monthloan = $('#obligations').val();
	
	$('body').append('<div class="reveal-modal-bg"></div>');
	
	$.ajax({
		type: "POST",
		url: "<?php echo($host) ?>control/ajaxapplyloanform.php",
		data:{'Type_Loan': 'vay_the_chap', 'Name': fullname, 'Phone': phonenumber, 'Email': emailadd, 'City': contry, 'Net_Salary': salary, 'birthday': ngsinh, 'Employment_Status': employment, 'Loan_Amount': amount, 'property_value': giatritaisan, 'obligations': monthloan},
		dataType: "json",
		success: function(response){
			
			if(response == true){
				resetinfoform();
				new Messi('Đăng ký thành công, chúng tôi sẽ liên hệ với bạn sau, cảm ơn bạn đã đăng ký', {
					title: 'Đăng Ký Thông Tin Vay Thế Chấp',
					titleClass: 'info', //
					buttons: [{
						id: 0, 
						label: 'Đóng', 
						val: 'X'
					}]
				});
			} else {
				new Messi('Đăng ký thất bại, bạn vui lòng thử lại sau!', {
					title: 'Đăng Ký Thông Tin Vay Thế Chấp',
					titleClass: 'anim error', //anim error
					buttons: [{
						id: 0, 
						label: 'Đóng', 
						val: 'X'
					}]
				});
			}
			$('.reveal-modal-bg').remove();
		}
	});
}

function resetinfoform() {
	var fullname = $('#Name').val('');
	var phonenumber = $('#Phone').val('');
	var emailadd = $('#Email').val('');
	var contry = $('#City').val('');
	var salary = $('#Net_Salary').val('');
	var ngsinh = $('#birthday').val('');
	var employment = $('#Employment_Status').val('');
	var amount = $('#Loan_Amount').val('');
	var giatritaisan = $('#property_value').val('');
	var monthloan = $('#obligations').val('');
}

//----------------------------------------------------
function validateDiv(div)
{

	var ni1 = document.getElementById(div);
	ni1.innerHTML = '';
}

function onFocusBlank(element,defaultVal){
	if(element.value==defaultVal){
		element.value="";
	}
}

function onBlurDefault(element,defaultVal){
	if(element.value==""){
		element.value = defaultVal;
	}
}

function Trim(strValue) 
{
	var j=strValue.length-1;i=0;
	while(strValue.charAt(i++)==' ');
	while(strValue.charAt(j--)==' ');
	return strValue.substr(--i,++j-i+1);
}

function containsdigit(param)
{
	mystrLen = param.length;
	for(i=0;i<mystrLen;i++)
	{
		if((param.charAt(i)=="0") || (param.charAt(i)=="1") || (param.charAt(i)=="2") || (param.charAt(i)=="3") || (param.charAt(i)=="4") || (param.charAt(i)=="5") || (param.charAt(i)=="6") || (param.charAt(i)=="7") || (param.charAt(i)=="8") || (param.charAt(i)=="9") || (param.charAt(i)=="/"))
		{
			return true;
		}
	}
	return false;
}
</script>


<script type="text/javascript" src="<?php echo($host) ?>js/jquery-uicaledate.js"></script>
<script>
var date = new Date();
var yearstart = date.getFullYear() - 100;
var yearend = date.getFullYear() - 18;
$( "#birthday" ).datepicker({
	defaultDate: date.getDay() + '/' + (date.getMonth() + 1) + '/'+yearstart, 
	dateFormat: 'dd/mm/yy',
	changeMonth: true,
	changeYear: true,
	yearRange: '' + yearstart + ':' + yearend
});
</script>